import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        //杨辉三角形
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[][] arr=new int[100][100];
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j <= i; j++) {
                if(j==0||i==j){
                    arr[i][j]=1;
                }else{
                    arr[i][j]=arr[i-1][j]+arr[i-1][j-1];
                }
            }
        }
        int count=0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= i; j++) {
                count++;
                if(arr[i][j]==n){
                    System.out.println(count);
                    return;
                }
            }
        }
    }
}
